class Trace;

class TraceNode {
private:
	string mFile;
	int mLine;
	string mFunc;
public:
	void print (std::ostream& os, int indent)
	{
		while(indent--) os << "  ";
		os << mFile << ":" << mLine << " " << mFunc << "(): " << endl;
	}
	TraceNode(string file, int lineNumber, string functionName);
	~TraceNode();
}


TraceNode::TraceNode(string file, int lineNumber, string functionName) : 
	mFile(file), mLine(lineNumber), mFunc(functionName) 
{
	Trace* trace = Trace::getTrace();
	trace->push(this);	
}
	
TraceNode::~TraceNode()
{
	Trace* trace = Trace::getTrace();
	trace->pop();
}
